package com.smbms.servlet;

import com.smbms.mapper.BillMapper;
import com.smbms.pojo.Bill;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class BillServiceImpl implements BillService {

    @Resource
    private BillMapper billMapper;

    @Override
    public List<Bill> getBillList(Map<String,Object> map) {
        return billMapper.getBillList(map);
    }

    @Override
    public Bill getBillById(Integer billid) {
        return billMapper.getBillById(billid);
    }

    @Override
    public boolean addBill(Bill bill) {

        if(billMapper.addBill(bill) > 0){
            return true;
        }
        return false;
    }

    @Override
    public int deleteVyId(Integer billid) {
        return billMapper.deleteById(billid);
    }

    @Override
    public boolean updateBill(Bill bill) {
        if(billMapper.updateBill(bill) > 0){
            return true;
        }
        return false;
    }


}
